package cn.idu.ismik.sample.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

public class Test03 {

    @MyAnnotation2(name = "idu", schools = {"11", "22"})
    void test() {

    }

    @MyAnnotation3("")
    void test2() {

    }
}

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation2 {
    //注解参数：参数类型+参数名();
    String name() default "";

    int age() default 1;

    int id() default -1;//如果默认值为-1，代表不存在

    String[] schools() default {"dd", "aa"};
}

@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@interface MyAnnotation3 {
    String value();
}